package com.to.aboomy.bannersample.pagetransformer;

import com.to.aboomy.banner.BannerViewPager;
import ohos.agp.components.Component;

/**
 * @author xujianhong
 * @since 2021-08-06
 */
public class ZoomInTransformer implements BannerViewPager.PageTransformer{
    float scale = 1F;
    @Override
    public void transformerPage(BannerViewPager.PageType pageType, Component page, float offset, float offsetPixels) {
        switch (pageType) {
            case PREVIOUS:
                break;
            case CURRENT:
//                if (offsetPixels >= 0) {
//                    scale = Math.abs(1.0F - offset);
//                    page.setAlpha( 0.0F);
//                } else {
//                    scale = offset + 1.0F;
//                    page.setAlpha(1.0F - (scale - 1.0F));
//                }
//                page.setPivotX((float)page.getWidth() * 0.5F);
//                page.setPivotY((float)page.getHeight() * 0.5F);
//                page.setScaleX(scale);
//                page.setScaleY(scale);
                break;
            case NEXT:
                break;
            case OTHER:
                break;
        }
    }
}
